#@layout()
#define script()
<script>

  function doSubmit() {
    ajaxSubmit("#form", function (data) {
        $("#entryId").attr("value", data.id);
        toastr.success('内容保存成功。');
    })
  }

    $("#submit").on("click", function () {
        doSubmit();
    })
    </script>
#end


#define content()

    <section class="content-header">

		<div class="container-fluid">
			<div class="row">
				<div class="col-sm-6">
					<div class="row mb-2">
						<div class="col-sm-12">
							<h1>
								#(jpressAddonMessage ? '编辑' : '新增')留言
								<small data-toggle="tooltip" title="" data-placement="right"
									   data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
								<small> 首页 / 留言管理 / #(jpressAddonMessage ? '编辑' : '新增')留言</small>
							</h1>
						</div>
					</div>
				</div>
			</div>
		</div><!-- /.container-fluid -->
    </section>

    <section class="content">

		<div class="container-fluid">
                <div class="card card-outline card-primary">

                    <form class=" form-setting" autocomplete="off"
                          action="/admin/message/jpress_addon_message/doSave"
                          method="POST" id="form">

                        <div class="card-body">
	                                <input type="hidden" id="entryId" name="jpressAddonMessage.id" value="#(jpressAddonMessage.id ??)">
		                            <div class="form-group row">
		                                <label class="col-sm-2 col-form-label">名字</label>
		                                <div class="col-sm-6">

										   <input type="input" name="jpressAddonMessage.name" class="form-control" value="#(jpressAddonMessage.name ??)"
		                                           placeholder="">
		                                </div>
		                            </div>
		                            <div class="form-group row">
		                                <label class="col-sm-2 col-form-label">电话</label>
		                                <div class="col-sm-6">

										   <input type="input" name="jpressAddonMessage.phone" class="form-control" value="#(jpressAddonMessage.phone ??)"
		                                           placeholder="">
		                                </div>
		                            </div>
		                            <div class="form-group row">
		                                <label class="col-sm-2 col-form-label">邮箱</label>
		                                <div class="col-sm-6">

										   <input type="input" name="jpressAddonMessage.email" class="form-control" value="#(jpressAddonMessage.email ??)"
		                                           placeholder="">
		                                </div>
		                            </div>

							<div class="form-group row">
								<label class="col-sm-2 col-form-label">标题</label>
								<div class="col-sm-6">

									<input type="input" name="jpressAddonMessage.title" class="form-control" value="#(jpressAddonMessage.title ??)"
										   placeholder="">
								</div>
							</div>

		                            <div class="form-group row">
		                                <label class="col-sm-2 col-form-label">留言</label>
		                                <div class="col-sm-6">

										   <input type="input" name="jpressAddonMessage.content" class="form-control" value="#(jpressAddonMessage.content ??)"
		                                           placeholder="">
		                                </div>
		                            </div>
		                            <div class="form-group row">
		                                <label class="col-sm-2 col-form-label">是否展示</label>
		                                <div class="col-sm-6">

										   <input type="checkbox" class="switchery" data-for="jpressAddonMessage_isshow" #checkedIf(jpressAddonMessage.show ??)>
                                           <input type="hidden" id="jpressAddonMessage_isshow" name="jpressAddonMessage.show">
		                                </div>
		                            </div>

                        </div>
                        <!-- /.card-body -->
                        <div class="card-footer">
                            <div class="offset-sm-2 col-sm-10 submit-block">
                                <div class="card-submit">
                                    <button id="submit" type="button" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.card-footer -->
                    </form>
                </div>
            </div>

    </section>

#end